﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="SanPhamList.ascx.cs" Inherits="SanPhamList" %>
<div class="MainFilter">
    <span class="headertext" runat="server" visible="false">Ngôn ngữ:</span>
    <asp:DropDownList ID="cmbLanguage" runat="server" Width="112px" AutoPostBack="True"
        OnSelectedIndexChanged="cmbLanguage_SelectedIndexChanged" Visible="false">
        <asp:ListItem Text="Vietnamese" Selected="True" Value="vi-VN"></asp:ListItem>
        <asp:ListItem Value="en-US">English</asp:ListItem>
    </asp:DropDownList>
    <span class="headertext">Nhóm sản phẩm:</span>
    <asp:DropDownList ID="cmbNhomSanPham" runat="server" Width="220px" OnSelectedIndexChanged="cmbNhomSanPham_SelectedIndexChanged"
        AutoPostBack="True">
    </asp:DropDownList>
     <span class="headertext">Trạng thái:</span>
      <asp:DropDownList ID="cmbStatus" runat="server" AutoPostBack="True" 
        onselectedindexchanged="cmbStatus_SelectedIndexChanged">
                <asp:ListItem Text="" Value="2" Selected="True"></asp:ListItem>
                <asp:ListItem Text="Sản phẩm mới" Value="0"></asp:ListItem>
                <asp:ListItem Text="Sản phẩm tiêu biểu" Value="1"></asp:ListItem>
            </asp:DropDownList>
</div>
<asp:GridView ID="grvSanPham" runat="server" AutoGenerateColumns="False" AllowPaging="True"
    PageSize="20" Font-Size="Small" CssClass="adminlist" OnPageIndexChanging="grvSanPham_PageIndexChanging"
    OnSelectedIndexChanged="grvSanPham_SelectedIndexChanged">
    <Columns>
        <asp:TemplateField HeaderText="X&#243;a">
            <HeaderTemplate>
                <input id="chkAll" onclick="javascript:SelectAllCheckboxes(this);" type="checkbox" />
            </HeaderTemplate>
            <ItemTemplate>
                <input runat="server" id="chkSelect" value='<%# "?mod=" +  WebComponents.ConvertType.Encode(this.AddModule) + "&id=" + Eval("ProductID") %>'
                    title='<%# Eval("ProductID") %>' type="checkbox" />
            </ItemTemplate>
            <ItemStyle HorizontalAlign="Center" Width="20px" />
            <HeaderStyle Width="20px" />
        </asp:TemplateField>
        <asp:TemplateField HeaderText="ID">
            <ItemTemplate>
                <asp:Label ID="lblFileID" runat="server" Text='<%# Eval("ProductID") %>'></asp:Label>
            </ItemTemplate>
            <HeaderStyle Width="40px" />
            <ItemStyle HorizontalAlign="Center" />
        </asp:TemplateField>
        <asp:TemplateField HeaderText="Tên sản phẩm">
            <ItemTemplate>
                <a href='?mod=<% = WebComponents.ConvertType.Encode(this.AddModule) %>&id=<%# Eval("ProductID")  %>'>
                    <asp:Label ID="lblTitle" runat="server" Text='<%# Eval("ProductName") %>'></asp:Label>
                </a>
            </ItemTemplate>
        </asp:TemplateField>
        <asp:TemplateField HeaderText="Mã sản phẩm">
            <ItemTemplate>
                <%# Eval("ProductCode") %>
            </ItemTemplate>
        </asp:TemplateField>
        <asp:TemplateField HeaderText="Hình ảnh">
            <ItemTemplate>
                <a href='?mod=<% = WebComponents.ConvertType.Encode(this.AddModule) %>&id=<%# Eval("ProductID")  %>'>
                    <img src="../<%# Eval("SmallImageUrl") %>" width="70" />
                </a>
            </ItemTemplate>
            <HeaderStyle Width="150px" />
            <ItemStyle HorizontalAlign="Center" />
        </asp:TemplateField>
         <asp:TemplateField HeaderText="Ngày tạo" SortExpression="AddedDate">
            <ItemTemplate>
                <%# ToDateTime(Eval("AddedDate")).ToShortDateString()%>
            </ItemTemplate>
            <ItemStyle HorizontalAlign="Center" />
        </asp:TemplateField>
        <asp:TemplateField HeaderText="Giá" SortExpression="UnitPrice">
            <ItemTemplate>
                <%# Eval("UnitPrice")%>
            </ItemTemplate>
            <ItemStyle HorizontalAlign="Center" />
        </asp:TemplateField>
        <asp:TemplateField HeaderText="Số lượng còn" SortExpression="Comments">
            <ItemTemplate>
               <%# Eval("Comments")%>
            </ItemTemplate>
            <ItemStyle HorizontalAlign="Center" />
        </asp:TemplateField>
        <asp:TemplateField HeaderText="Số lần xem" SortExpression="ViewCount">
            <ItemTemplate>
                <asp:Label ID="lblOrderId" runat="server" Text='<%# Eval("ViewCount") %>'></asp:Label>
            </ItemTemplate>
            <ItemStyle HorizontalAlign="Center" />
        </asp:TemplateField>
       <%-- <asp:TemplateField HeaderText="Vị tr&#237;" SortExpression="OrderId">
            <ItemTemplate>
                <asp:Label ID="lblViewCount" runat="server" Text='<%# Eval("OrderId") %>'></asp:Label>
            </ItemTemplate>
            <ItemStyle HorizontalAlign="Center" />
        </asp:TemplateField>--%>
    </Columns>
    <EmptyDataTemplate>
        <div align="center" id="EmptyData">
            Không có thông tin...</div>
    </EmptyDataTemplate>
    <RowStyle CssClass="row0" />
    <AlternatingRowStyle CssClass="row1" />
</asp:GridView>
